<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ page  import="java.sql.*" %>
<jsp:useBean id="ObjectSub" class="DAO.DAOAdmin" scope="page" />
<%@taglib prefix="ajax" uri="http://ajaxtags.org/tags/ajax" %>
<script language="javascript">
    function setSubID(id)
    {
        myFormSub.subID.value =  id;
    }

</script>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="../header.jsp" />
        <link rel="stylesheet" href="../css/style.css" />
        <link rel="stylesheet" href="../css/front.css"  />

        <title>Themes</title>
    </head>


    <body bgcolor="#154978">

        <table width="1024" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
            <!--DWLayoutTable-->
            <tr>
                <td width="1024" height="157" valign="top" background="../images/Banner.jpg">

                </td>
            </tr>
            <tr>
                <td height="463" valign="top">
                    <table width="100%" border="0" cellpadding="2" cellspacing="2" >
                        <!--DWLayoutTable-->
                        <tr>
                            <td height="28" colspan="2" valign="top" background="../images/top_button.gif">
                            </td>
                        </tr>
                        <tr>
                            <td width="150" height="537" valign="top">

                                <!-- MENU -->
                                <%@include file="menu.jsp" %>
                                <!--END MENU-->	</td>
                            <td width="858" align="center" valign="top" bgcolor="#CCCCCC">
                                <!-- The Start Add Subjec -->
                                <h1 style="color:red">Subject</h1>
                                <br>
                                <span id="updateSubject"></span>
                                <form action="include/actionAddSubject.jsp" method="post" name="myFormSubjec">
                                    Add Subject : <input type="text" name="SubName" />
                                    <input type="submit" value="Add Subjet" />
                                </form>
                                <br>
                                <table border="1" style="border:solid 1px; border-collapse:collapse" >
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>SubjectName</th>
                                            <th>Status</th>
                                            <th>Editer</th>
                                            
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <%
                                            ResultSet rs = ObjectSub.selectSuject2();
                                            while(rs.next())
                                                {
                                        %>
                                        <tr>
                                            <td><a href="#"><%=rs.getString(1)%></a></td>
                                            <td>
                                                    <a href="displaySubSubject.jsp?id=<%=rs.getString(1)%>"><%=rs.getString(2)%></a>
                                            </td>
                                            <td>
                                                <a href="include/displaySubject.jsp?id=<%=rs.getString(1)%>&<%if(rs.getBoolean(3) == true){%>display=false<% } else {%>display=true<% } %>">
                                                 <%
                                                if(rs.getBoolean(3) == true)
                                                {
                                                %>
                                                <img src="images/preview_f2.png" height="20" width="20" border="0"/>
                                                <% } else {
                                                %> <img src="images/unpreview_f2.png" height="20" width="20" border="0"/><% } %>
                                                </a>
                                                
                                            </td>
                                            <td>
                                                <ajax:anchors target="updateSubject" >
                                                    <a href="include/updateSubject.jsp?id=<%=rs.getString(1)%>"><img src="../images/button/system/24-tool-a.png" alt="Edit"  border="0"/></a>
                                                </ajax:anchors>
                                            </td>
                                           
                                        </tr>
                                        <% } %>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>
